\(\int x \sqrt {a^2+2 a b x+b^2 x^2} \, dx\) [140]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [C] (warning: unable to verify)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 22, antiderivative size = 61 \[ \int x \sqrt {a^2+2 a b x+b^2 x^2} \, dx=-\frac {a (a+b x) \sqrt {a^2+2 a b x+b^2 x^2}}{2 b^2}+\frac {\left (a^2+2 a b x+b^2 x^2\right )^{3/2}}{3 b^2} \]

[Out]

1/3*(b^2*x^2+2*a*b*x+a^2)^(3/2)/b^2-1/2*a*(b*x+a)*((b*x+a)^2)^(1/2)/b^2

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 61, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {654, 623} \[ \int x \sqrt {a^2+2 a b x+b^2 x^2} \, dx=\frac {\left (a^2+2 a b x+b^2 x^2\right )^{3/2}}{3 b^2}-\frac {a (a+b x) \sqrt {a^2+2 a b x+b^2 x^2}}{2 b^2} \]

[In]

Int[x*Sqrt[a^2 + 2*a*b*x + b^2*x^2],x]

[Out]

-1/2*(a*(a + b*x)*Sqrt[a^2 + 2*a*b*x + b^2*x^2])/b^2 + (a^2 + 2*a*b*x + b^2*x^2)^(3/2)/(3*b^2)

Rule 623

Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[(b + 2*c*x)*((a + b*x + c*x^2)^p/(2*c*(2*p + 1)
)), x] /; FreeQ[{a, b, c, p}, x] && EqQ[b^2 - 4*a*c, 0] && NeQ[p, -2^(-1)]

Rule 654

Int[((d_.) + (e_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[e*((a + b*x + c*x^2)^(p +
 1)/(2*c*(p + 1))), x] + Dist[(2*c*d - b*e)/(2*c), Int[(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, p}
, x] && NeQ[2*c*d - b*e, 0] && NeQ[p, -1]

Rubi steps \begin{align*} \text {integral}& = \frac {\left (a^2+2 a b x+b^2 x^2\right )^{3/2}}{3 b^2}-\frac {a \int \sqrt {a^2+2 a b x+b^2 x^2} \, dx}{b} \\ & = -\frac {a (a+b x) \sqrt {a^2+2 a b x+b^2 x^2}}{2 b^2}+\frac {\left (a^2+2 a b x+b^2 x^2\right )^{3/2}}{3 b^2} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.44 (sec) , antiderivative size = 79, normalized size of antiderivative = 1.30 \[ \int x \sqrt {a^2+2 a b x+b^2 x^2} \, dx=\frac {x^2 (3 a+2 b x) \left (\sqrt {a^2} b x+a \left (\sqrt {a^2}-\sqrt {(a+b x)^2}\right )\right )}{-6 a^2-6 a b x+6 \sqrt {a^2} \sqrt {(a+b x)^2}} \]

[In]

Integrate[x*Sqrt[a^2 + 2*a*b*x + b^2*x^2],x]

[Out]

(x^2*(3*a + 2*b*x)*(Sqrt[a^2]*b*x + a*(Sqrt[a^2] - Sqrt[(a + b*x)^2])))/(-6*a^2 - 6*a*b*x + 6*Sqrt[a^2]*Sqrt[(
a + b*x)^2])

Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 2.

Time = 0.20 (sec) , antiderivative size = 25, normalized size of antiderivative = 0.41

method result size
default \(-\frac {\operatorname {csgn}\left (b x +a \right ) \left (b x +a \right )^{2} \left (-2 b x +a \right )}{6 b^{2}}\) \(25\)
gosper \(\frac {x^{2} \left (2 b x +3 a \right ) \sqrt {\left (b x +a \right )^{2}}}{6 b x +6 a}\) \(30\)
risch \(\frac {\sqrt {\left (b x +a \right )^{2}}\, a \,x^{2}}{2 b x +2 a}+\frac {x^{3} b \sqrt {\left (b x +a \right )^{2}}}{3 b x +3 a}\) \(46\)

[In]

int(x*((b*x+a)^2)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/6*csgn(b*x+a)*(b*x+a)^2*(-2*b*x+a)/b^2

Fricas [A] (verification not implemented)

none

Time = 0.40 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.21 \[ \int x \sqrt {a^2+2 a b x+b^2 x^2} \, dx=\frac {1}{3} \, b x^{3} + \frac {1}{2} \, a x^{2} \]

[In]

integrate(x*((b*x+a)^2)^(1/2),x, algorithm="fricas")

[Out]

1/3*b*x^3 + 1/2*a*x^2

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 95 vs. \(2 (46) = 92\).

Time = 0.88 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.56 \[ \int x \sqrt {a^2+2 a b x+b^2 x^2} \, dx=\begin {cases} \sqrt {a^{2} + 2 a b x + b^{2} x^{2}} \left (- \frac {a^{2}}{6 b^{2}} + \frac {a x}{6 b} + \frac {x^{2}}{3}\right ) & \text {for}\: b^{2} \neq 0 \\\frac {- \frac {a^{2} \left (a^{2} + 2 a b x\right )^{\frac {3}{2}}}{3} + \frac {\left (a^{2} + 2 a b x\right )^{\frac {5}{2}}}{5}}{2 a^{2} b^{2}} & \text {for}\: a b \neq 0 \\\frac {x^{2} \sqrt {a^{2}}}{2} & \text {otherwise} \end {cases} \]

[In]

integrate(x*((b*x+a)**2)**(1/2),x)

[Out]

Piecewise((sqrt(a**2 + 2*a*b*x + b**2*x**2)*(-a**2/(6*b**2) + a*x/(6*b) + x**2/3), Ne(b**2, 0)), ((-a**2*(a**2
 + 2*a*b*x)**(3/2)/3 + (a**2 + 2*a*b*x)**(5/2)/5)/(2*a**2*b**2), Ne(a*b, 0)), (x**2*sqrt(a**2)/2, True))

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 75, normalized size of antiderivative = 1.23 \[ \int x \sqrt {a^2+2 a b x+b^2 x^2} \, dx=-\frac {\sqrt {b^{2} x^{2} + 2 \, a b x + a^{2}} a x}{2 \, b} - \frac {\sqrt {b^{2} x^{2} + 2 \, a b x + a^{2}} a^{2}}{2 \, b^{2}} + \frac {{\left (b^{2} x^{2} + 2 \, a b x + a^{2}\right )}^{\frac {3}{2}}}{3 \, b^{2}} \]

[In]

integrate(x*((b*x+a)^2)^(1/2),x, algorithm="maxima")

[Out]

-1/2*sqrt(b^2*x^2 + 2*a*b*x + a^2)*a*x/b - 1/2*sqrt(b^2*x^2 + 2*a*b*x + a^2)*a^2/b^2 + 1/3*(b^2*x^2 + 2*a*b*x
+ a^2)^(3/2)/b^2

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 39, normalized size of antiderivative = 0.64 \[ \int x \sqrt {a^2+2 a b x+b^2 x^2} \, dx=\frac {1}{3} \, b x^{3} \mathrm {sgn}\left (b x + a\right ) + \frac {1}{2} \, a x^{2} \mathrm {sgn}\left (b x + a\right ) - \frac {a^{3} \mathrm {sgn}\left (b x + a\right )}{6 \, b^{2}} \]

[In]

integrate(x*((b*x+a)^2)^(1/2),x, algorithm="giac")

[Out]

1/3*b*x^3*sgn(b*x + a) + 1/2*a*x^2*sgn(b*x + a) - 1/6*a^3*sgn(b*x + a)/b^2

Mupad [B] (verification not implemented)

Time = 9.15 (sec) , antiderivative size = 55, normalized size of antiderivative = 0.90 \[ \int x \sqrt {a^2+2 a b x+b^2 x^2} \, dx=\frac {\left (8\,b^2\,\left (a^2+b^2\,x^2\right )-12\,a^2\,b^2+4\,a\,b^3\,x\right )\,\sqrt {a^2+2\,a\,b\,x+b^2\,x^2}}{24\,b^4} \]

[In]

int(x*((a + b*x)^2)^(1/2),x)

[Out]

((8*b^2*(a^2 + b^2*x^2) - 12*a^2*b^2 + 4*a*b^3*x)*(a^2 + b^2*x^2 + 2*a*b*x)^(1/2))/(24*b^4)